package com.force.abril.api.maintanence.client;

import java.io.Serializable;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

import com.force.abril.api.maintanence.client.request.MaintenanceEntry;
import com.force.abril.api.maintanence.client.request.RequestCreate;
import com.force.provider.SalesForceConnectionProvider;


public class BookingMaintenanceClientService extends WebServiceGatewaySupport implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Autowired
	private SalesForceConnectionProvider connectionProvider;

	public BookingMaintenanceClientService() {
	}

	public void create ( MaintenanceEntry requestEntry ) {
		
		RequestCreate request = new RequestCreate();
		request.setEntry(requestEntry);
		Object response = this.getWebServiceTemplate()
							  .marshalSendAndReceive(connectionProvider.getServerUrl() + "class/BookingMaintenanceService"
									  				,request
													, new SalesForceSessionHeaderCallback(this.getWebServiceTemplate() 
																					      , connectionProvider)	);		
	}
	
	
}
